project(
  db_manager
  LANGUAGES CXX
)

set(CMAKE_CXX_STANDARD 17)
find_package(Qt5 COMPONENTS Sql Core REQUIRED)

add_definitions(-DQLS_DB_MANAGER_LIBRARY)

set(_srcs
    src/qls_specification.cpp
    src/qls_db_conn_pool.cpp
    src/pojo/user.cpp
    src/dao/user_dao.cpp
    src/service/user_service.cpp
)

set(_headers
    include/db_manager/qls_db_manager_global.h
    include/db_manager/qls_specification.h
    include/db_manager/qls_db_conn_pool.h
    include/db_manager/pojo/user.h
    include/db_manager/dao/user_dao.h
    include/db_manager/service/user_service.h
)

add_library(db_manager SHARED ${_srcs} ${_headers})
target_link_libraries(db_manager PUBLIC
    Qt5::Sql Qt5::Core ${CMAKE_THREAD_LIBS_INIT}
)
target_link_libraries(db_manager PRIVATE settings)
target_include_directories(db_manager PUBLIC include)
